export const transformLabelValue = (data, { labelKey, valueKey }) => {
  if (labelKey !== 'label' || valueKey !== 'value') {
    const deep = (items) => {
      items.forEach((item) => {
        if (item.children && Array.isArray(item.children) && item.children.length > 0) {
          deep(item.children);
        }
        item.label = item[labelKey];
        item.value = item[valueKey];
      });
    };
    deep(data);
  }
  return data;
};
